package com.cneiu.ppms.web.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.cneiu.ppms.web.base.BaseService;
import com.cneiu.ppms.web.model.PublicCodeModel;

/**
 * 公共编码表业务层
 * 
 * @author Administrator
 * 
 */
public class PublicCodeService extends BaseService{

	/**
	 * 根据类型查询公共编码Grid
	 * 
	 * @param params
	 * @return
	 */
	public static List<PublicCodeModel> getTypeList(Map<String, String> params){
		String type = params.get("type") == null ? "" : params.get("type");
		List<PublicCodeModel> list = new ArrayList<PublicCodeModel>();
		StringBuffer SQL = new StringBuffer();
		SQL.append("SELECT * FROM SUP_CODE WHERE 1=1 ");
		if (!"".equals(type)){
			SQL.append("AND SC_TYPE_NAME = ? ");
		}
		list = PublicCodeModel.dao.find(SQL.toString(), type);
		return list;
	}
}
